# 1 设计窗口
# 2 添加控件
# 3 大小方向固定
# 4 实现发送 + 取消功能



 from tkinter import *
import time
def main():
    
    def sendMsg：
        strMsg = '我：'+ time.strftime("%y-%m-%d %H:%M:%S",time.localtime()) + '\n'
        textMsgList.insert(END,strMsg)
        textMsgList.insert(END,textMsg.get('0.0',END))
        textMsg.delete('0.0',END)


     def cancelMsg:
         textMsg.delete('0.0')   
    t = Tk()
    t,title("与anny老师聊天中")
    t.mainroop()
    # 创建容器 装东西的
    frmLT = Frame(width = 500,height = 320，bg= 'white')
    frmLC = Frame(width = 500,height = 150)
    frmLB = Frame(width = 500,height = 30)
    frmRT = Frame(width = 200,height = 500)
    #布局
    frmLT.grid()
    frmLC.grid()
    frmLB.grid()
    # rawspan 合并
    frmRT.grid(row = 0,column = 1,rowspan = 3,padx = 3,pady = 2)
    textMsgList =  Text(frmLT)
    textMsg = Text(frmLC)
    btnSender = Button(frmLB,text='发送'，width ='8')
    btnCancel = Button(frmLB,text='取消'，width ='8')
    # photoImage 只能用gif图片
    imageLink = PhontImage(file = "y.gif")
    lblImage = Label(frmLB,image = imageLink)
    
    btnSender.grid(row = 2,colomn = 1,command = sendMsg：)
    btnCancel.grid(row = 2,colomn = 2)
    lblImage.grid()
    textMsgList.grid()
    textMsg.grid()
    frmLT.grid_propagate(0)
    frmLC.grid_propagate(0)
    frmLB.grid_propagate(0)
    frmRT.grid_propagate(0)
if __name__ ='_main_':
    main()